package com.jiyun.Games.controller;

import com.domain.Games;
import com.jiyun.Games.service.GamesService;
import com.spyx.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/games")
@CrossOrigin
public class GamesController {
    @Autowired
    private GamesService gamesService;
    @PostMapping("/list")
    public Result list() {
        List<Games> games = gamesService.findAll();

        return Result.ok(games);
    }
}
